package com.stfalcon.chatkit.sample.holder;

import android.view.View;

import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.recyclerview.widget.RecyclerView;

import com.stfalcon.chatkit.sample.R;

import org.jetbrains.annotations.NotNull;

public abstract class AbstractHolder extends RecyclerView.ViewHolder {

    public AppCompatTextView getUserName() {
        return userName;
    }

    private AppCompatTextView userName;

    public AppCompatImageView getUserHeader() {
        return userHeader;
    }

    private AppCompatImageView userHeader;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    private String userId;


    public AbstractHolder(@NonNull View itemView) {
        super(itemView);

        this.userName = itemView.findViewById(R.id.nameTextView);

        this.userHeader = itemView.findViewById(R.id.mainImageView);

        this.initListener();
    }

    /**
     * 初始化事件
     */
    protected abstract void initListener();
}
